package com.jlastu.androidsx.ui.user;

import android.view.View;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.jlastu.androidsx.R;
import com.jlastu.androidsx.adapter.FragmentAdapter;
import com.jlastu.androidsx.databinding.ActivityOrderListBinding;
import com.jlastu.androidsx.fragment.OrderWaitFrament;
import com.jlastu.androidsx.fragment.RecieveFragment;
import com.jlastu.androidsx.fragment.ShippedFragment;

import java.util.ArrayList;
import java.util.List;

import cn.project.base.baseui.BaseNormalActivity;

public class OrderListActivity extends BaseNormalActivity<ActivityOrderListBinding> {
    @Override
    protected int getLayoutId() {
        return R.layout.activity_order_list;
    }

    @Override
    protected void initView() {
        mBinding.toolbar.tvTitle.setText("订单列表");
        mBinding.toolbar.rlBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        FragmentManager fragmentManager = getSupportFragmentManager();
        List<Fragment> fragments = new ArrayList<>();
        fragments.add(new OrderWaitFrament());
        fragments.add(new ShippedFragment());
        fragments.add(new RecieveFragment());
        List<String> tab = new ArrayList<>();
        tab.add("待发货");
        tab.add("已发货");
        tab.add("已收货");
        FragmentAdapter fragmentAdapter = new FragmentAdapter(fragmentManager, fragments, tab);
        mBinding.vp.setAdapter(fragmentAdapter);
        mBinding.tl.setupWithViewPager(mBinding.vp);
    }

    @Override
    protected void initData() {

    }
}
